package com.relytosoft.mizar.media.display.api.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 转码
 *
 * @Author SunLi
 * @Date: 2022/4/15 11:15
 * @Version 1.0
 */
@FeignClient(url = "${relytosoft.mizar.transcoding.openApiUrl}", name = "Media-Transcoding")
public interface VideoTransFeignService {

    /**
     * 转码服务 添加rtsp/rtmp/hls拉流代理
     *
     * @param secret      api密钥
     * @param vhost       流的虚拟主机
     * @param app         流的应用名
     * @param stream      流的id名
     * @param url         拉流地址
     * @param enable_rtsp 是否转协议为rtsp/webrtc
     * @param enable_rtmp 是否转协议为rtmp/flv
     * @return
     */
    @GetMapping("/index/api/addStreamProxy?enable_hls=0&enable_mp4=0&enable_ts=0&enable_fmp4=0")
    String addStreamProxy(@RequestParam("secret") String secret, @RequestParam("vhost") String vhost, @RequestParam("app") String app, @RequestParam("stream") String stream, @RequestParam("url") String url, @RequestParam("enable_rtsp") Integer enable_rtsp, @RequestParam("enable_rtmp") Integer enable_rtmp);

    @GetMapping("/index/api/delStreamProxy")
    String closeStram(@RequestParam("secret") String secret, @RequestParam("key") String key);

}
